<%@ Page Language="C#" MasterPageFile="~/master/admin.master" AutoEventWireup="true"
    CodeFile="news-list.aspx.cs" Inherits="admin_news_list" Title="Untitled Page" %>

<%@ Register Src="~/controls/wucEmptyGridMessage.ascx" TagName="EmptyGridMessage"
    TagPrefix="wuc" %>
<%@ Register Namespace="ECommerce.Library.Web" TagPrefix="ucc" %>
<asp:Content ID="cntMiddleContent" ContentPlaceHolderID="cphMiddleContent" runat="Server">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td height="30" bgcolor="#f6f6f6" class="plnk" style="padding: 0 10px;" align="left">
                <a href="<%= AutoGear.BLL.CustomSiteMap.AdminHome %>">Dashboard</a> &raquo; <a href="<%= AutoGear.BLL.CustomSiteMap.NewsList %>">
                    News List</a></td>
        </tr>
        <tr>
            <td height="10">
            </td>
        </tr>
        <tr>
            <td style="background: url(<%=rootPath %>images/admin/page-title-back.jpg); background-repeat: repeat-x;">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="10" align="left">
                            <img src="<%=rootPath %>images/admin/page-title-left.jpg" width="5" height="30" alt=" " /></td>
                        <td align="left" class="rate">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td align="left">
                                        <strong>News List</strong></td>
                                    <td align="right">
                                        <asp:Button runat="server" ID="btnNewsAdd" CssClass="custombutton" OnClick="btnNewsAdd_Click"
                                            Text="Add News" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td width="10" align="right" valign="middle">
                            <img src="<%=rootPath %>images/admin/page-title-right.jpg" width="5" height="30"
                                alt=" " /></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td align="center" style="background: #f6f6f6; border: 1px solid #cacaca">
                <table width="40%" border="0" cellpadding="0" cellspacing="5">
                    <tbody>
                        <tr>
                            <td>
                                <strong>News Name</strong></td>
                            <td>
                                <asp:TextBox ID="tbxSearchByName" runat="server" CssClass="txtbox"></asp:TextBox></td>
                            <td>
                                <asp:ImageButton ID="imgSearchButton" runat="server" ImageUrl="~/images/admin/btn-search.jpg"
                                    AlternateText=" " Width="71px" Height="25px" OnClick="Search_Click" /></td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center">
                &nbsp;</td>
        </tr>
        <tr>
            <td align="center">
                <ucc:ResponseMessage ID="uccResponseMessage" runat="server"></ucc:ResponseMessage>
            </td>
        </tr>
        <tr>
            <td align="center">
                <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: 1px solid #cacaca;">
                    <tr>
                        <td height="35" align="right" style="padding: 0 10px; background-color: #f6f6f6">
                            <asp:ImageButton ID="imbRemove" runat="server" ImageUrl="~/images/admin/btn-remove.gif"
                                AlternateText=" " Width="69px" Height="25px" OnClick="Delete_Items" /></td>
                    </tr>
                    <tr>
                        <td style="padding: 10px; border-top: 1px solid #cacaca; border-bottom: 1px solid #cacaca;">
                            <asp:GridView ID="grvNews" runat="server" AllowPaging="false" AllowSorting="false"
                                AutoGenerateColumns="false" PageSize="50" GridLines="none" CellPadding="7" CellSpacing="0"
                                Width="100%" OnRowDataBound="News_RowDataBound">
                                <Columns>
                                    <asp:TemplateField>
                                        <HeaderStyle Width="30%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridHeader" />
                                        <ItemStyle Width="30%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridRow" />
                                        <HeaderTemplate>
                                            <table>
                                                <tr>
                                                    <td rowspan="2" valign="middle">
                                                        Name</td>
                                                    <td>
                                                        <asp:ImageButton ID="imbNameSortUp" runat="server" ImageUrl="~/images/admin/sort-up.jpg"
                                                            OnCommand="Grid_Sort" CommandName="sort" CommandArgument="NewsName Asc" /></td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:ImageButton ID="imbNameSortDown" runat="server" ImageUrl="~/images/admin/sort-down.jpg"
                                                            OnCommand="Grid_Sort" CommandName="sort" CommandArgument="NewsName Desc" /></td>
                                                </tr>
                                            </table>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lkbBrandName" runat="server" Text='<%# Eval("NewsName") %>' CssClass="leftlink"
                                                CommandArgument='<%# Eval("NewsId") %>' CommandName="edit_link" OnCommand="NavigateToEditPage"></asp:LinkButton>
                                            <asp:HiddenField ID="hdfNewsId" runat="server" Value='<%# Eval("NewsId") %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <HeaderStyle Width="50%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridHeader" />
                                        <ItemStyle Width="50%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridRow" />
                                        <HeaderTemplate>
                                            Brief Description
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <%# Server.HtmlDecode((string)Eval("NewsBriefDescription"))%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <HeaderStyle Width="10%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridHeader" />
                                        <ItemStyle Width="10%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridRow" />
                                        <HeaderTemplate>
                                            Active
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:CheckBox ID="cbxIsActive" runat="server" Enabled="false" Checked='<%# Eval("IsActive") %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <HeaderStyle Width="10%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridHeader" />
                                        <ItemStyle Width="10%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridRow" />
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lkbEdit" runat="server" Text="Edit" CssClass="leftlink" CommandArgument='<%# Eval("NewsId") %>'
                                                CommandName="edit" OnCommand="Grid_Edit"></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <HeaderStyle Width="5%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridHeader" />
                                        <ItemStyle Width="5%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridRow" />
                                        <HeaderTemplate>
                                            <asp:CheckBox ID="cbxSelectAll" runat="server" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:CheckBox ID="cbxSelect" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <EmptyDataRowStyle HorizontalAlign="center" />
                                <EmptyDataTemplate>
                                    <wuc:EmptyGridMessage ID="EmptyGridMessage1" runat="server" MessageText="No News Found">
                                    </wuc:EmptyGridMessage>
                                </EmptyDataTemplate>
                            </asp:GridView>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding: 2px">
                            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td height="30" align="center" bgcolor="#dde9ff" style="padding: 0 10px" colspan="2">
                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td width="50%" align="left" class="plnk">
                                                    Displaying
                                                    <asp:Label ID="lblFirstItemNumber" runat="server"></asp:Label>
                                                    to
                                                    <asp:Label ID="lblLastItemNumber" runat="server"></asp:Label>
                                                    (of
                                                    <asp:Label ID="lblTotalItem" runat="server"></asp:Label>
                                                    News)</td>
                                                <td width="50%" align="right" class="plnk">
                                                    Pages:
                                                    <asp:Repeater ID="rptPaging" runat="server">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="hlkPage" runat="server" Text='<%# Container.DataItem %>' OnCommand="Paging_Command"
                                                                CommandName="paging" CommandArgument='<%# Container.DataItem %>' CssClass="plnkinactive"></asp:LinkButton>
                                                        </ItemTemplate>
                                                        <SeparatorTemplate>
                                                            &nbsp;</SeparatorTemplate>
                                                        <FooterTemplate>
                                                            &nbsp;<asp:LinkButton ID="hlkAll" runat="server" Text="All" CommandName="paging"
                                                                CommandArgument="All" OnCommand="Paging_Command" CssClass="plnkinactive"></asp:LinkButton>
                                                        </FooterTemplate>
                                                    </asp:Repeater>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
